package com.youshang520i.demo.controller;

import com.sun.org.apache.xpath.internal.operations.Bool;
import com.youshang520i.demo.MyBean;
import com.youshang520i.demo.MyBean2;
import com.youshang520i.demo.entity.BeanEntity;
import com.youshang520i.demo.service.HelloService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author youshang
 * @date 2021/02/26 10:34
 **/
@RestController
@RequestMapping("/hello")
public class HelloController implements ApplicationContextAware {

    @Autowired
    private HelloService helloService;

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println(applicationContext);
    }
//    @Autowired
//    private MyBean myBean1;
//    @Autowired
//    private MyBean2 myBean2;
//
//    @RequestMapping("/lite")
//    public Boolean hello_lite(){
//        Object lite = helloService.lite();
//        boolean equals = lite.equals(myBean1);
//        System.out.println(equals);
//        return equals;
//    }
//
//    @RequestMapping("/full")
//    public Boolean hello_full(){
//        Object full = helloService.full();
//        boolean equals = full.equals(myBean2);
//        System.out.println(equals);
//        return equals;
//    }
}
